//
//  YCProfileButton.m
//  YCSchool
//
//  Created by yanglinxia on 16/4/27.
//  Copyright © 2016年 yanglinxia. All rights reserved.
//  咨询主界面上面分类按钮

#import "YCProfileButton.h"

@implementation YCProfileButton

- (void)setHighlighted:(BOOL)highlighted{}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setTitleColor:[UIColor yc_colorWithUInt:0x666666] forState:UIControlStateNormal];
        [self setTitleColor:[UIColor yc_colorWithUInt:0xffffff] forState:UIControlStateSelected];
        self.layer.borderWidth = 1;
        self.layer.borderColor = [UIColor yc_colorWithUInt:0xaaaaaa alpha:0.4].CGColor;
        self.titleLabel.font = [UIFont systemFontOfSize:13];
        
        // 添加遮罩可以处理4条边只显示哪一条或几条
//        CALayer *mask = [CALayer layer];
//        mask.backgroundColor = [[UIColor blackColor] CGColor];
//        CGRect maskFrame = CGRectInset(self.bounds, 0, 1);
//        mask.opaque = 0;
//        maskFrame.origin.y = 0;
//        mask.frame = maskFrame;
//        self.layer.mask = mask;
    }
    return self;
}

- (void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    self.backgroundColor = selected?[UIColor yc_colorWithUInt:0x4766ab]:[UIColor whiteColor];
}

@end
